#include "Light.h"
#include <Runtime/Graphics/GraphicsManager.h>


Light::Light() {
	mData = {};
	mData.ambientColor = XMFLOAT3(1.0f, 1.0f, 1.0f);
	mData.ambientIntensity = 0.3f;
	mData.lightColor = XMFLOAT3(0.3f, 0.2f, 0.7f);
	mData.lightIntensity = 2.0f;
	mData.lightPosition = { 0.0f, 5.0f, 0.0f };

	GraphicsBufferDesc desc;
	desc.ResourceUsage = ResourceUsage::DYNAMIC;
	desc.CPUAccess = BufferCPUAccess::WRITE;
	desc.Usage = BufferUsage::CONSTANT_BUFFER;
	desc.SizeInBytes = sizeof(LightCBData);
	desc.StructureByteStride = sizeof(LightCBData);
	desc.MiscFlags = 0;
	desc.InitialData = &mData;

	mBuffer = GraphicsManager::GetInstance().GetMainDevice()->CreateGraphicsBuffer(desc);
}